package com.colt.contentcenter.sentineldemo;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @program: content-center
 * @description: 限流降级class
 * @author: colt
 * @create: 2020-05-26 15:44
 **/
@Slf4j
public class TestControllerFallbackClass {

    /**
     * @Description: 1.5 处理降级
     * sentinel1.6后  可以处理Throwable
     * @Param:
     * @return:
     * @Author: colt
     * @Date: 2020/5/26
     */
    public static String fallBack(@RequestParam(required = false) String a ,BlockException block){
        log.warn("资源被降级了",block);
        return "资源被降级了,fallback";
    }
}
